<template>
    <page-body >
        <view class="page" >
    <view class="flex benben-position-layout flex flex-wrap align-center bindPhoneNumberPage_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center justify-between flex-sub bindPhoneNumberPage_fd0_0'      >
            <view   class='flex flex-wrap align-center bindPhoneNumberPage_fd0_0_c0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  bindPhoneNumberPage_fd0_0_c0_c0'    >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center justify-end bindPhoneNumberPage_fd0_0_c0'      >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex flex-direction flex-wrap align-center benben-flex-layout bindPhoneNumberPage_flex_1"    >
        <image class='bindPhoneNumberPage_fd1_0'  mode="aspectFit"  :src='STATIC_URL+"63.png"'></image>
</view>
        
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout bindPhoneNumberPage_flex_2"    >
            <view   class='flex flex-wrap align-center bindPhoneNumberPage_fd2_0'      >
        <image class='bindPhoneNumberPage_fd2_0_c0'  mode="aspectFit"  :src='STATIC_URL+"64.png"'></image>
<benben-input class='flex-sub bindPhoneNumberPage_fd2_0_c1'   type="number" :placeholder="`请输入手机号`" confirm-type="done" :maxlength="11" placeholder-style="color:rgba(255, 255, 255, 1);font-size:32rpx"  v-model="mobile" />
</view>
    <view   class='flex flex-wrap align-center bindPhoneNumberPage_fd2_1'      >
        <image class='bindPhoneNumberPage_fd2_0_c0'  mode="aspectFit"  :src='STATIC_URL+"78.png"'></image>
<benben-input class='flex-sub bindPhoneNumberPage_fd2_0_c1'   type="number" :placeholder="`请输入验证码`" confirm-type="done" :maxlength="4" placeholder-style="color:rgba(255, 255, 255, 1);font-size:32rpx"  v-model="code" />
<benben-send-verification-code key='1710987107127' ref="vCode1710987107127" class=' bindPhoneNumberPage_fd2_1_c2'  after-text='后重新获取' before-text='获取验证码' emptye-text='请输入手机号' validate-text='请输入正确手机号' account-type='phone' :auto='true' type='5'  :phone="mobile" ></benben-send-verification-code>
</view>
    <view   class='flex flex-wrap align-center bindPhoneNumberPage_fd2_1'      >
        <image class='bindPhoneNumberPage_fd2_0_c0'  mode="aspectFit"  :src='STATIC_URL+"65.png"'></image>
<benben-flex-password-diy v-model="password" class-name="flex flex align-center bindPhoneNumberPage_fd2_2_c1"  :placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true' placeholder-style="color:rgba(255, 255, 255, 1);font-size:32rpx" >
      <template #show>
        <text class='fu-iconfont2  bindPhoneNumberPage_fd2_2_c1_icon1'   data-type="show">&#xE837;</text>
      </template>
      <template #hide>
        <text class='fu-iconfont2  bindPhoneNumberPage_fd2_2_c1_icon2'   data-type="hide">&#xEBCC;</text>
      </template>
    </benben-flex-password-diy>
</view>
    <view   class='flex flex-wrap align-center bindPhoneNumberPage_fd2_1'      >
        <image class='bindPhoneNumberPage_fd2_0_c0'  mode="aspectFit"  :src='STATIC_URL+"79.png"'></image>
<benben-input class='flex-sub bindPhoneNumberPage_fd2_0_c1'   type="text" :placeholder="`请输入邀请码（选填）`" confirm-type="done" :maxlength="10" placeholder-style="color:rgba(255, 255, 255, 1);font-size:32rpx"  v-model="invite_code" />
</view>
<button class='bindPhoneNumberPage_fd2_4'  @tap.stop="bangdmobileFunc()"  >确定</button>
</view>
        
<!---flex布局flex布局结束-->
    
    
        </view>
    </page-body>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        
        
        data(){
			return {"mobile":"","code":"","password":"","invite_code":"","dataUserInfo":{"userinfo":{"user_token":"","id":"","avatar":"","real_name":"","nickname":"","email":"","gender":"","mobile":"","birthday":"","client_id":"","phone":""}},"third_type":"","extend_info":""};
		},
		computed:{
            
		},
		watch:{},
		onLoad(options){
            let {third_type,extend_info}=options
if (third_type !== undefined) this.third_type = third_type
if (extend_info !== undefined) this.extend_info = extend_info
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //绑定手机号
                async bangdmobileFunc(){
                                if(!validate(this.mobile,'require')){
                 this.$message.info('请输入手机号');
                 return false;
            }
            if(!validate(this.mobile,'phone')){
                 this.$message.info('请输入正确的手机号');
                 return false;
            }
            if(!validate(this.code,'require')){
                 this.$message.info('请输入验证码');
                 return false;
            }
            if(!validate(this.code,'captcha')){
                 this.$message.info('请输入正确的验证码');
                 return false;
            }
            if(!validate(this.password,'require')){
                 this.$message.info('请输入密码');
                 return false;
            }
            if(!validate(this.password,'password')){
                 this.$message.info('密码格式错误');
                 return false;
            }
    //请求方法
    //数据验证
    
  let datadataUserInfo = await this.$api.dbPost(global.apiUrls.post5d7757d28d076, {
    account:this.mobile,code:this.code,code_type:'5',password:this.password,invite_code:this.invite_code,account_type:'mobile',third_type:this.third_type,extend_info:this.extend_info
  });
  if(!datadataUserInfo) return
  if (datadataUserInfo.data.code != 1) {
    this.$message.info(datadataUserInfo.data.msg);
    return
  } 
  let infodataUserInfo = datadataUserInfo.data;
  this.dataUserInfo = infodataUserInfo.data
  
                this.$store.commit('saveToken', this.dataUserInfo.userinfo.user_token)
                this.$store.commit('updateUserInfo', this.dataUserInfo.userinfo)
    this.$urouter.navigateTo(`/pages/tabBar/loginPage/loginPage`);
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:url(image-path('146.png')) no-repeat;background-size: 100% 100%;
        }
    .bindPhoneNumberPage_flex_0{
        width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;
    }
    .bindPhoneNumberPage_fd0_0_c0_c0{
        font-size:36rpx;color:#333;
    }
    .bindPhoneNumberPage_fd0_0_c0{
        width:120rpx;
    }
    .bindPhoneNumberPage_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;
    }
    .bindPhoneNumberPage_flex_1{
        padding:88rpx 0rpx 0rpx 0rpx;
    }
    .bindPhoneNumberPage_fd1_0{
        width:160rpx;height:160rpx;border-radius:33rpx 33rpx 33rpx 33rpx;
    }
    .bindPhoneNumberPage_flex_2{
        padding:0rpx 56rpx 0rpx 56rpx;
    }
    .bindPhoneNumberPage_fd2_4{
        background:var(--benbenbgColor2);border-radius:50rpx 50rpx 50rpx 50rpx;font-size:32rpx;color:var(--benbenFontColor3);width:638rpx;height:88rpx;line-height:88rpx;margin:104rpx 0rpx 32rpx 0rpx;
    }
    .bindPhoneNumberPage_fd2_2_c1_icon2{
        width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;
    }
    .bindPhoneNumberPage_fd2_2_c1_icon1{
        width:88rpx;line-height:88rpx;text-align:center;font-size:40rpx;color:var(--benbenFontColor3);
    }
    ::v-deep .bindPhoneNumberPage_fd2_2_c1{
        height:45rpx;width:560rpx;font-size:32rpx;margin:0rpx 0rpx 0rpx 32rpx;color:var(--benbenFontColor3);
    }
    .bindPhoneNumberPage_fd2_1_c2{
        line-height:42rpx;text-align:center;font-size:28rpx;color:var(--benbenFontColor4);
    }
    .bindPhoneNumberPage_fd2_1{
        border-bottom:1px solid #eee;padding:40rpx 0rpx 40rpx 0rpx;
    }
    .bindPhoneNumberPage_fd2_0_c1{
        height:45rpx;margin:0rpx 0rpx 0rpx 32rpx;color:var(--benbenFontColor3);font-size:32rpx;font-weight:400;line-height:45rpx;
    }
    .bindPhoneNumberPage_fd2_0_c0{
        width:34rpx;height:34rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .bindPhoneNumberPage_fd2_0{
        border-bottom:1px solid #eee;padding:40rpx 0rpx 40rpx 0rpx;margin:40rpx 0rpx 0rpx 0rpx;
    }
</style>